﻿#include "FITKAcousticsSpectraManager.h"

namespace Acoustics
{
    QList<FITKAcousticsAbstractSpectra*> FITKAcousticsSpectraManager::getSpectraByType(FITKAcousticsAbstractSpectra::AcousticsSpectraType t)
    {
        QList<FITKAcousticsAbstractSpectra*> fs;
        //遍历全部对象
        const int n = this->getDataCount();
        for (int i =0; i< n; i++)
        {
            //类型筛选
            FITKAcousticsAbstractSpectra* s = this->getDataByIndex(i);
            if (s && s->getSpectraType() == t)
                fs.append(s);
        }
        return fs;
    }

    void FITKAcousticsSpectraManager::resetSpectraValues(const QList<double> HzList)
    {
        //遍历对象
        const int n = this->getDataCount();
        for (int i = 0; i < n; i++)
        {
            //重置全部数据
            FITKAcousticsAbstractSpectra* s = this->getDataByIndex(i);
            if (s)
                s->resetSpectraValues(HzList);
        }
    }

}



